<template>
  <div id="app" class="public-layout app-container">
    <el-container>
      <el-header>
        <div class="header-content">
          <div class="logo_home">korubo辅助</div>
          <div class="menu-header">
            <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
                     background-color="#00092e"
                     text-color="#fff"
                     active-text-color="#ffd04b">
              <el-menu-item index="1">首页</el-menu-item>
              <el-menu-item index="2">帮助中心</el-menu-item>
            </el-menu>
          </div>
        </div>
      </el-header>
      <el-main>
        <router-view/>
      </el-main>
      <el-footer>
        <div class="footer-content">
          © 2025 korubo辅助. All rights reserved.
        </div>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'PublicLayout',
  data() {
    return {
      activeIndex: '1',
    }
  },
  created() {
    this.$router.push('/')
  },
  methods: {
    handleSelect(index) {
      switch (index) {
        case '1':
          this.$router.push('/')
          break;
        case '2':
          this.$router.push('/help')
          break;
      }
    }
  },
}
</script>

<style scoped>
.el-tabs__nav-wrap {
  height: 90px !important;
}

.el-menu-item {
  height: 70px;
  margin-top: 10px;
  font-size: 20px;
}

.menu-header {
  display: flex;
  color: #409EFF;
  width: 80%;
  height: 80px;
}

.el-header {
  height: 80px !important;
}

/* 全/* 全局灰色背景 */
.app-container {
  background-color: #00092e;
  min-height: 100vh; /* 确保背景覆盖整个视口 */
}

.el-container {
  min-height: 99vh;
}

/* 可选：统一其他元素的背景 */
body, html {
  margin: 0;
  padding: 0;
  background-color: #15752a !important; /* 覆盖默认样式 */
}

.public-layout {
  min-height: 100vh;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo_home {
  width: 150px;
  font-size: 25px;
  font-weight: bold;
  color: #409EFF;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.el-main {
  padding-top: 80px;
  background-color: #03031c;
}

.el-footer {
  background-color: #222940;
  border-top: 1px solid #e6e6e6;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #909399;
}
</style>
